package active;

import util.Config;

import java.sql.*;

public class BeforeSendToMQ {
    private static Connection conn = null;

    public static String ifSendToMQ() throws ClassNotFoundException, SQLException {
        Config.load("../conf/tmis.properties");
        Class.forName(Config.FORNAME);
        conn = DriverManager.getConnection(Config.DBURL, Config.USERNAME, Config.PASSWORD);
        conn.setAutoCommit(false);
        Statement stmt = conn.createStatement();
        String sql = "select paramvalue from apprunparam where paramcode='0044'";
        ResultSet rs = stmt.executeQuery(sql);
        String paramvalue = "";
        while (rs.next()) {
            paramvalue = rs.getString("paramvalue");
        }
        conn.commit();
        conn.close();
        return paramvalue;
    }
}
